import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue'),
    },
    {
      path: '/test',
      name: 'test',
      component: () => import('../views/test/HomeView.vue'),
    },
    {
      path: '/study/one',
      name: 'studyone',
      component: () => import('../views/study/OneView.vue'),
    },
    {
      path: '/crud/news',
      name: 'crudnews',
      component: () => import('../views/crud/NewsView.vue'),
    },
    {
      path: '/crud/newsinfo',
      name: 'crudnewsinfo',
      component: () => import('../views/crud/NewsInfoView.vue'),
    },
    {
      path: '/crud/newsdetail',
      name: 'crudnewsdetail',
      component: () => import('../views/crud/NewsDetailView.vue'),
    },
    {
      path: '/crud/billboard',
      name: 'crudbillboard',
      component: () => import('../views/crud/BillboardView.vue'),
    },
    {
      path: '/crud/footballteam',
      name: 'crudfootballteam',
      component: () => import('../views/crud/FootballteamView.vue'),
    },
    {
      path: '/crud/footballteaminfo',
      name: 'crudfootballteaminfo',
      component: () => import('../views/crud/FootballteamInfoView.vue'),
    },
    {
      path: '/dataquery/news2',
      name: 'dataquerynews2',
      component: () => import('../views/dataquery/News2View.vue'),
    },
    {
      path: '/user/reg',
      name: 'userreg',
      component: () => import('../views/user/RegView.vue'),
    },
    {
      path: '/user/login',
      name: 'userlogin',
      component: () => import('../views/user/LoginView.vue'),
    },
    {
      path: '/user/main',
      name: 'usermain',
      component: () => import('../views/user/MainView.vue'),
    },
  ],
})

export default router
